﻿<%@ Control language="vb" Inherits="pnc.Publisher.Content.ContentEdit" AutoEventWireup="false" Explicit="True" Codebehind="pnc.Publisher.ContentEdit.ascx.vb" %>
<%@ Register TagPrefix="dnn" TagName="SectionHead" Src="~/controls/SectionHeadControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>

<script type="text/javascript">

function displayTab(panel, clientId) 
{ 
   var panels = <%= OptionPanelsString %>;
   var tabs = <%= OptionTabsString %>;
   var current = 0;
   var state = "";
   var savedPanel = 0;
   
   if (panel == -1) 
   {
	   var tabBox = document.getElementById('<%= txtTab.ClientID %>');
	   if (tabBox)
	   {
	
		    panel = tabBox.value;
	   }
	   
       //panel = savedPanel;
       savedPanel = -1;
   }
      
   for (var i = 0; i < panels.length; i++) 
   {
       var currPanel = document.getElementById(panels[i]);
       if (currPanel)
       {
  			currPanel.style.display = "none";
  			var currTab = document.getElementById(tabs[i]);
  			if (currTab) {
  			    if (i != panel)
				    currTab.parentNode.className = "";
			    else
			    {
				    if (i == savedPanel)
					    state = (state == "block" ? "none" : "block");
    		   
				    currPanel.style.display = state;
				    currTab.parentNode.className = "selected";
				    current = i;
			    }
  			}

		}
   }
   
   var tabBox = document.getElementById('<%= txtTab.ClientID %>');
   if (tabBox)
   {
		tabBox.value = panel;
   } 
}




</script>
<table id="tblMain" style="width:100%" cellppacing="0" cellpadding="0" border="0">
  <tr>
    <td class="pncContent_IconCell" valign="middle" style="width:40px;"><asp:image id="imgMessage" Runat="server"></asp:image></td>
    <td class="pncContent_MessageCell" valign="bottom" style="width:100%"><asp:label id="lblMessage" Runat="server"></asp:label></td>
  </tr>
  <tr>
    <td class="pncContent_StatusCell" colspan="2"><asp:label cssclass="Subhead" id="lblCurrentlyEditing" Runat="server"></asp:label></td>
  </tr>
  <tr>
    <td colspan="2"><asp:placeholder id="plhTabs" Runat="server"></asp:placeholder></td>
  </tr>
  <tr>
    <td colspan="2" valign="top">
      <asp:placeholder id="plhEditor" Runat="server"></asp:placeholder>
      <div class="pncTabpanel" id="pncEditor_OptionPanel_Advanced" style="DISPLAY: none">
        <table style="width:100%" cellpadding="4" cellspacing="4" border="0">
          <tr>
            <td class="pncContent_IconCell" valign="top" align="left" style="width:40px"><asp:image id="imgAdvanced" Runat="server"></asp:image></td>
            <td class="pncContent_HeaderCell" valign="top" align="left" style="width:100%"><asp:label id="lblAdvancedHeader" CssClass="Head" resourcekey="lblAdvancedHeader" runat="server"></asp:label></td>
          </tr>
          <tr>
            <td class="pncContent_DescriptionCell" valign="middle" align="left" colspan="2">
              <table style="width:600px;">
                <tr>
                  <td><asp:label id="lblAdvancedDescription" CssClass="normal" resourcekey="lblAdvancedDescription"
											runat="server"></asp:label>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell" valign="middle" align="left" colspan="2">
              <table cellspacing="0" cellpadding="0">
                <tr>
                  <td class="pncContent_ButtonPadding"><asp:linkbutton id="cmdAltRole" CssClass="pncContent_CommandButton" resourcekey="cmdAltRole" runat="server" CausesValidation="False">Save and Add New Content for</asp:linkbutton></td>
                  <td>&nbsp;<asp:dropdownlist id="cboRoles" runat="server" AutoPostBack="false" DataValueField="RoleName" DataTextField="RoleName" Width="200px"></asp:dropdownlist></td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell" valign="top" align="left" colspan="2"><asp:label id="lblContentList" resourcekey="lblContentList" runat="server"></asp:label></td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell" valign="top" align="left" colspan="2">
              <asp:datagrid id="grdContent" CssClass="Normal" runat="server" Width="544px" DataKeyField="ItemID"
								AutoGenerateColumns="False" GridLines="Horizontal" BorderColor="#CDCDCD" BorderStyle="Dotted">
								<HeaderStyle CssClass="pncContent_HeaderRow" Height="18px"></HeaderStyle>
								<ItemStyle CssClass="pncContent_ItemRow"></ItemStyle>
								<Columns>
									<asp:TemplateColumn HeaderText="SortOrder">
										<ItemTemplate>
											<span class="Normal">
												<%#DataBinder.Eval(Container.DataItem,"Priority").ToString() %>
											</span>
										</ItemTemplate>
									</asp:TemplateColumn>
									<asp:TemplateColumn HeaderText="Role">
										<ItemTemplate>
											<span class="Normal">
												<a href='<%# EditURL("itemID", DataBinder.Eval(Container.DataItem,"ItemID").ToString(), "edit") %>'>
													<%#GetRolename(DataBinder.Eval(Container.DataItem,"Role").ToString()) %>
												</a>
											</span>
										</ItemTemplate>
									</asp:TemplateColumn>
									<asp:TemplateColumn>
										<ItemTemplate>
											<asp:ImageButton Runat="server" ImageUrl="~/DesktopModules/pnc.Publisher.Content/Images/up_green.gif"
												CommandName="MoveUp" CausesValidation="False" ID="imgMoveUp"></asp:ImageButton>
										</ItemTemplate>
									</asp:TemplateColumn>
									<asp:TemplateColumn>
										<ItemTemplate>
											<asp:ImageButton Runat="server" ImageUrl="~/DesktopModules/pnc.Publisher.Content/Images/down_green.gif"
												CommandName="MoveDown" CausesValidation="False" ID="imgMoveDown"></asp:ImageButton>
										</ItemTemplate>
									</asp:TemplateColumn>
									<asp:TemplateColumn>
										<ItemTemplate>
											<asp:ImageButton Runat="server" ImageUrl="~/DesktopModules/pnc.Publisher.Content/Images/delete.gif"
												CommandName="Delete" CausesValidation="False" ID="imgDelete"></asp:ImageButton>
										</ItemTemplate>
									</asp:TemplateColumn>
								</Columns>
							</asp:datagrid>
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="pncContent_IconCell" valign="top" align="left" style="width:40px;"><asp:image id="imgStat" Runat="server"></asp:image></td>
            <td class="pncContent_HeaderCell" valign="top" align="left" style="width:100%;"><asp:label id="lblShowStat" CssClass="Head" resourcekey="lblShowStat" runat="server"></asp:label></td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell"><asp:checkbox id="chkShowLastUpdatedBy" Runat="server"></asp:checkbox></td>
            <td class="pncContent_MessageCell"><asp:label id="lblShowLastUpdatedBy" CssClass="normal" resourcekey="lblShowLastUpdatedBy" runat="server"></asp:label></td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell"><asp:checkbox id="chkShowLastUpdatedAt" Runat="server"></asp:checkbox></td>
            <td class="pncContent_MessageCell"><asp:label id="lblShowLastUpdatedAt" CssClass="normal" resourcekey="lblShowLastUpdatedAt" runat="server"></asp:label></td>
          </tr>
        </table>
      </div>
      <div class="pncTabpanel" id="pncEditor_OptionPanel_Newsletter" style="DISPLAY: none">
        <table style="width:100%" cellpadding="4" cellspacing="4" border="0">
          <tr>
            <td class="pncContent_IconCell" valign="top" align="left" style="width:40px;"><asp:image id="imgNewsletter" Runat="server"></asp:image></td>
            <td class="pncContent_HeaderCell" valign="top" align="left" style="width:100%;"><asp:label id="lblNewsletterHeader" CssClass="Head" resourcekey="lblNewsletterHeader" runat="server"></asp:label></td>
          </tr>
          <tr>
            <td class="pncContent_DescriptionCell" valign="middle" align="left" colspan="2">
              <table style="width:100%" cellpadding="4" cellspacing="4" border="0">
                <tr>
	              <td><asp:label id="lblNewsletterDescription" CssClass="Normal" resourcekey="lblNewsletterDescription" runat="server"></asp:label></td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell" colspan="2"><asp:checkboxlist id="chkRoles" runat="server" datatextfield="RoleName" datavaluefield="RoleName" repeatcolumns="2" cssclass="Normal" EnableViewState="True"></asp:checkboxlist></td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell" colspan="2"><dnn:label id="plSendMode" runat="server" controlname='rblSendMode"' suffix=":"></dnn:label></td>
          </tr>
          <tr>
            <td class="pncContent_MessageCell" colspan="2">
              <asp:radiobuttonlist id="optSendAction" runat="server" cssclass="Normal" repeatdirection="Horizontal">
                <asp:listitem resourcekey="Synchronous" value="S">Synchronous</asp:listitem>
                <asp:listitem resourcekey="Asynchronous" value="A" selected="True">Asynchronous</asp:listitem>
              </asp:radiobuttonlist>
            </td>
          </tr>
          <tr>
            <td colspan="2"><asp:linkbutton id="cmdSend" CssClass="pncContent_CommandButton" resourcekey="cmdSend" runat="server" CausesValidation="False">Send Newsletter</asp:linkbutton></td>
          </tr>
        </table>
      </div>		
    </td>
  </tr>
</table>
<br />
<br />
<p><asp:checkbox id="chkHideForRegistered" runat="server"></asp:checkbox>&nbsp;<asp:label id="lblHideForRegistered" runat="server" resourcekey="lblHideForRegistered" CssClass="Normal"></asp:label></p>
<br />
<br />
<table id="tblButton" cellspacing="0" cellpadding="0" style="text-align:left;" border="0">
  <tr>
    <td valign="middle"><asp:linkbutton id="cmdUpdate" runat="server" resourcekey="cmdUpdate" CssClass="pncContent_CommandButton" CausesValidation="false">Save Content</asp:linkbutton></td>
    <td valign="middle">&nbsp;</td>
    <td valign="middle"><asp:linkbutton id="cmdCancel" runat="server" resourcekey="cmdCancel" CssClass="pncContent_CommandButton" CausesValidation="False">Back</asp:linkbutton></td>
  </tr>
</table>
<asp:textbox id="txtTab" style="DISPLAY: none" Runat="server" Text="0"></asp:textbox>
<script type="text/jscript" language="javascript">
   var oldEvt = window.onload; window.onload = function() { if (oldEvt) oldEvt(); displayTab(-1);}
</script>
